﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Collections.Generic;
public partial class _35newpart_匿名类型 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        AnonymousTypes AnonymouseClass = new AnonymousTypes();
       // AnonymouseClass.Test();
    }
}

/// <summary>
/// （匿名类型）的摘要说明
/// </summary>
public class AnonymousTypes
{
    public int ID { get; set; }
    public string Name { get; set; }
    public int Age { get; set; }

   /// <summary>
   /// add new obj
   /// </summary>
    List<AnonymousTypes> list = new List<AnonymousTypes>
        {
            new AnonymousTypes { ID = 1, Name = "webabcd", Age = 10 },
            new AnonymousTypes { ID = 2, Name = "webabcdefg", Age = 20 },
            new AnonymousTypes { ID = 3, Name = "webabcdefghijklmn", Age = 30 }
        };

 

    public void Test()
    {
        // listAnonymousTypes - 匿名类型
        var oo = new { ss = "人粉", ps = "东东", ooo = "啊啊" };
        System.Web.HttpContext.Current.Response.Write(oo.ooo);

        //anonymouse Type 匿名类型
        var ps = from PP in list
                 orderby PP.ID descending
                 select PP;
        ///anonymouse type tst
    }
  
}


